package cn.hdu.liang.ch1;

public class StringInSwitch {
    public String generate(String name, String gender) {
        String title = "";
        switch(gender) {
            case "男":
                title = name + " 先生";
                break;
            case "女":
                title = name + " 女士";
                break;
            default:
                title = name;
        }
        return title;
    }

    public static void main(String[] args) {
        StringInSwitch t = new StringInSwitch();
        System.out.println(t.generate("张三", "男"));
        System.out.println(t.generate("李四", "女"));
        System.out.println(t.generate("王五", "未知"));
    }
}
